Practice Set 1
We'll cover the following
Practice Set 1#
We’ll build upon the MovieIndustry database we have been working with throughout the lesson. We’ll add two more tables for a total of four. The relations between the tables are pictorially depicted below.
Connect to the terminal below by clicking in the widget. Once connected, the command line prompt will show up. Enter or copy and paste the command ./DataJek/Lessons/quiz.sh and wait for the MySQL prompt to start-up.
Write and execute queries for the following questions:
- Write a query that prints the top three movies by box office collection?
Expected Result:
Name |
---|
movie 1 |
movie 2 |
movie 3 |
- Can you write a query to determine if any two actors share the same second name?
Expected Result:
Actors_With_Shared_SecondNames |
---|
actor 1 |
actor 2 |
… |
… |
actor n |
- Write a query to count the number of actors who share the same second name. Print the second name along with the count.
Expected Result:
Actors_With_Shared_SecondNames | Count |
---|---|
second name 1 | cnt#1 |
second name 2 | cnt#2 |
… | … |
… | … |
second name n | cnt#n |
- Write a query to display all those actors who have acted in at least one movie.
Expected Result:
Actors_Acted_In_Atleast_1_Movies |
---|
actor 1 |
actor 2 |
… |
… |
actor n |
- As a corollary to the previous question, can you find the different ways of listing those aspiring actors who haven’t acted in any movie yet?
Expected Result:
Actors_With_No_Movies |
---|
actor 1 |
actor 2 |
… |
… |
actor n |
Quiz 16
Solution Practice Set 1
Mark as Completed
Report an Issue